<template>
  <Headerbar />
  <ResearchCard :id="id"></ResearchCard>
  <n-card>
    <n-tabs type="line" animated>
      <n-tab-pane name="comment" tab="评论">
        <CommentList :id="id" :targetType="2" />
      </n-tab-pane>
      <n-tab-pane name="question" tab="问题">
        <ForumList :id="id" />
      </n-tab-pane>
    </n-tabs>
  </n-card>
</template>
<script setup>
import ResearchCard from './components/ResearchCard.vue'
import CommentList from '@/components/Comment/CommentList.vue'
import ForumList from './components/ForumList.vue'

const route = useRoute()
const id = ref(encodeURIComponent(route.params.id))

watch(
  () => route.params,
  () => {
    id.value = encodeURIComponent(route.params.id)
  }
)
</script>

<style scoped lang="scss"></style>
